[UI/UX] Stop Button Appears Only During Active Playback #5778#5779
[UI/UX] Stop Button Appears Only During Active Playback #5778#5779anshukaushik4700 wants to merge 4 commits intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@anshukaushik4700 This change toggles visibility based only on button clicks, not actual playback state. |
|
@vanshika2720 Thanks for the feedback — that’s a good point. The original intent of this change was to address the initial UX issue on the home page by ensuring the Stop button is hidden before any playback begins and only shown once playback starts via user interaction. I agree that tying the visibility purely to click events can desync the UI if playback ends naturally or is triggered programmatically. To make this more robust, I can update the implementation to hook into the existing playback start/stop lifecycle so the Stop button reflects the actual playing state rather than just button clicks. I’ll push an update aligning the visibility with the real playback state. |
|
Hello @walterbender @omsuneri, I’d appreciate it if you could review this PR at your convenience. Thank you! |
|
I haven't tested this yet, but there are lots of corner cases you need to consider. Many interactive projects use the start button to load event handlers. The events (e.g., clicking on a mouse) may trigger play, which would require the stop button to become visible. |
|
Apologies for the delayed response @walterbender sir — I was occupied with academic exams over the past few days. Thank you for pointing this out. You’re absolutely right — I hadn’t fully considered scenarios where the Start button initializes event handlers and playback is triggered later through user interactions (such as mouse clicks or other events). At the moment, the Stop button visibility is mainly controlled based on direct button clicks, which is not a reliable approach for these interactive cases. I understand, playback may begin independently of the initial Start click, and the Stop button should reflect the actual playback state. I will revise the implementation to tie the Stop button visibility to the real playback state instead of button events and also add corner cases, and I will test it carefully to ensure those corner cases are handled properly. If there are any specific corner cases you recommend testing against, please let me know — I’d be happy to include them |
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
e44d8a4 to
5f27ad3
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
Hi @walterbender, Please review this solution and let me know if any adjustments are needed! Changes Madeindex.html
js/activity.js
js/turtle-singer.js
Testing Status ✅Jest Tests: 106/106 passing ✅
Manual Testing Completed:
|
|
I am pretty confused by the behavior at this point. It is nice to not have the stop button before anything is running. But the appearance and state of the start button seems inconsistent thereafter. Just with the default project, run from start and the stop button stays red after play ends. Clicking on the start block, it never turns red. |
Description:
This PR fixes issue #5778
where the "Stop" button was visible on the Music Blocks home page even when no music was playing. Previously, both "Play" and "Stop" buttons were visible initially, which could be confusing for users.
With this update:
Steps to Reproduce:
Expected Behavior After Fix:
Screenshots / Video
Implementation Details:
Updated the UI logic controlling button visibility during playback.
Ensured no impact on existing functionalities.
Code changes are minimal and fully backward-compatible.
Bug Fix
Feature
Performance
Tests
Documentation
closes #5778